package com.gp.billsrecord.base

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.viewbinding.ViewBinding
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import com.gp.billsrecord.databinding.FragmentFilterSelectBinding
import com.xujichang.viewbinding.ViewBindingBase
//底部弹窗的基类
abstract class BaseBottomSheetDialog<VB : ViewBinding> : BottomSheetDialogFragment(),
    ViewBindingBase<VB> {
    private var _binding: VB? = null
    val binding get() = _binding!!

    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        return createBinding(inflater, container) {
            _binding = it
        }.root
    }

    override fun onDestroyView() {
        super.onDestroyView()
        _binding = null
    }
}